using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class AmmoGold { 
	[RuntimeInitializeOnLoadMethod]
	static void SubscribeEvents(){
		Projectile.ProjectileFiring+=ProjectileFiringEventHandler;
	}
	const int id = 1;

	static void ProjectileFiringEventHandler(object _sender,ProjectileEventArgs e){
		Projectile sender = _sender as Projectile;
		if(sender.stat.consumedAmmo==null) return;
		if(!sender.stat.consumedAmmo.ContainsKey(id)) return;
		if(sender.stat.consumedAmmo[id]<=0) return;
		int roundConsumed = sender.stat.consumedAmmo[id];

		sender.stat.speed.AddMultAdd(roundConsumed*0.4f,0);
		sender.stat.damage.AddMultAdd(roundConsumed*0.25f,0);
		sender.stat.penetration.AddAdd(roundConsumed,0);
		sender.stat.bounce.AddAdd(roundConsumed,0);
	}
	
}
